package com.onenine.app.model;

import com.onenine.app.response.AppUpdateResponse;

public class AppUpdateItem {

    private int isUpVersion;//0无1有
    private String versionNum;
    private String packageNum;
    private String versionDesc;
    private String versionDownload;
    private String targetPath;
    private boolean showNotification;

    public AppUpdateItem(AppUpdateResponse response, String targetPath) {
        this.isUpVersion = response.getIsUpVersion();
        this.versionNum = response.getVersionNum();
        this.packageNum = response.getPackageNum();
        this.versionDesc = response.getVersionDesc();
        this.versionDownload = response.getVersionDownload();
        this.targetPath = targetPath;
    }

    public AppUpdateItem(AppUpdateResponse response, String targetPath, boolean showNotification) {
        this.isUpVersion = response.getIsUpVersion();
        this.versionNum = response.getVersionNum();
        this.packageNum = response.getPackageNum();
        this.versionDesc = response.getVersionDesc();
        this.versionDownload = response.getVersionDownload();
        this.targetPath = targetPath;
        this.showNotification = showNotification;
    }

    public int getIsUpVersion() {
        return isUpVersion;
    }

    public String getVersionNum() {
        return versionNum == null ? "" : versionNum;
    }

    public String getPackageNum() {
        return packageNum == null ? "" : packageNum;
    }

    public String getVersionDesc() {
        return versionDesc == null ? "" : versionDesc;
    }

    public String getVersionDownload() {
        return versionDownload == null ? "" : versionDownload;
    }

    public void setTargetPath(String targetPath) {
        this.targetPath = targetPath;
    }

    public String getTargetPath() {
        return targetPath == null ? "" : targetPath;
    }

    public boolean isShowNotification() {
        return showNotification;
    }
}
